package com.dawn.socket;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

public class Session {

	private int id;
	private String name;
	private byte[] binaryName;
	private ByteBuffer buff;

	private List<ByteBuffer> msgList = new ArrayList<ByteBuffer>();

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public ByteBuffer getBuff() {
		return buff;
	}

	public void setBuff(ByteBuffer buff) {
		this.buff = buff;
	}

	public void addMsg(ByteBuffer buf) {
		this.msgList.add(buf);
	}

	public ByteBuffer popMsg() {

		return msgList.remove(0);
	}

	public boolean hasMsg() {
		return !msgList.isEmpty();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public byte[] getBinaryName() {
		return binaryName;
	}

	public void setBinaryName(byte[] binaryName) {
		this.binaryName = binaryName;
	}

}
